function hb(money, num) {
    if(money <= 0 || num <= 0) return
    let remianingNumber = num //剩余金额
    let amount = 0.00 //每人的金额
    let sum = 0
    while(remianingNumber > 1) {
        amount = Math.round((2 * (money / remianingNumber) * Math.random()) * 100) / 100
        console.log(`获取红包${amount}`)
        money -= amount
        remianingNumber--
        sum += amount
    }
    let last = Math.round(money * 100) / 100
    console.log(`获取红包${last}`)
    sum += last
    console.log(Math.round(sum))
}

hb(100, 5)



